<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ping</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.6/socket.io.min.js"></script>
    <script type=text/javascript>
        var $SCRIPT_ROOT = {{request.script_root | tojson | safe}};
    </script>
    <script type=text/javascript>
        $(function () {
            $('#but').bind('click', function () {
                $.get($SCRIPT_ROOT + '/shell_ping', {
                    addr: $('#addr').val()
                }, function (data) {
                    $("#num2").text(data);
                });
                return false;
            });
        });
    </script>
    <script type="text/javascript" charset="utf-8">
        var socket = io.connect('http://127.0.0.1:5000/socket_ping');

        socket.on('response3', function (msg) {
            $('#num').append(msg);
        });

    </script>
</head>
<body>
<h1>ping</h1>
addr:<input type=text id="addr">
<button id='but'>执行</button>
<pre><div id="num"></div></pre>
<!-- <br> -->
<!-- <textarea rows="30" cols="100" id="num" name="comment" form="usrform"></textarea> -->
</body>
</html>